#include <stdio.h>
//BC30
int main()
{
    int seconds=0;
    int h=0,m=0,s=0;
    scanf("%d",&seconds);
    h=seconds/3600;
    m=seconds%3600/60;
    s=seconds%60;
    printf("%d %d %d",h,m,s);

    return 0;
}
